/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Admission;

import Academic.AcademicBean;
import Address.AddressBean;
import Book.BookBean;
import BookCategory.BookCategoryBean;
import BookType.BookTypeBean;
import Category.CategoryBean;
import Country.CountryBean;
import Course.CourseBean;
import Facility.FacilityBean;
import Parents.ParentsBean;
import State.StateBean;
import Student.StudentBean;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author mishra
 */
public class getStudentdetail extends HttpServlet {

   
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            int aid=Integer.parseInt(request.getParameter("aId"));
            AdmissionBean ab=Admission.Query.viewSpecificforstu(aid);
            CourseBean cb=ab.getCourseBean();
            StudentBean sb=ab.getStudentBean();
            AddressBean adb=sb.getAddressBean();
            StateBean stb=adb.getStateBean();
            CountryBean cob=stb.getCountryBean();
            CategoryBean cab=ab.getCategoryBean();
            
            out.println("<a href = 'javascript:void(0)' onclick='quickClose()'><span id='quickclose'><img src='../../img/close.png'></span></a>");
            out.println("<div id='records'>");
            
            out.println("<div class='rowood'>");
            out.println("<div><b>Admission ID :&nbsp; </b>"+ab.getAddmissionId()+"</div>");
            out.println("<div><b>Student Email :&nbsp; </b>"+ab.getStudentEmail()+"</div>");
            out.println("</div>");
            
            out.println("<div class='roweven'>");
            out.println("<div><b>Student Name :&nbsp; </b>"+sb.getStudentName()+"</div>");
            out.println("<div><b>Session/Semester :&nbsp; </b>"+ab.getStudentSession()+","+ab.getSemester()+"</div>");
            out.println("</div>");
            
            out.println("<div class='rowood'>");
            out.println("<div><b>Course :&nbsp; </b>"+cb.getCourseName()+"</div>");
            out.println("<div><b>Stream :&nbsp; </b>"+cb.getStream()+"</div>");
            out.println("</div>");
            
            out.println("<div class='roweven'>");
            out.println("<div><b>Category :&nbsp; </b>"+cab.getCategory()+"</div>");
            out.println("<div><b>Gendor :&nbsp; </b>"+sb.getGender()+"</div>");
            out.println("</div>");
            
            out.println("<div class='rowood'>");
            out.println("<div><b>Date of Birth :&nbsp; </b>"+sb.getDob()+"</div>");
            out.println("<div><b>Address1 :&nbsp; </b>"+adb.getAddress1()+"</div>");
            out.println("</div>");
                                                                                    
            out.println("<div class='roweven'>");
            out.println("<div><b>Address2 :&nbsp; </b>"+adb.getAddress2()+"</div>");
            out.println("<div><b>Pin Code :&nbsp; </b>"+adb.getPinCode()+"</div>");
            out.println("</div>");
            
            out.println("<div class='rowood'>");
            out.println("<div><b>State:&nbsp; </b>"+stb.getStateName()+"</div>");
            out.println("<div><b>Country :&nbsp; </b>"+cob.getCountryName()+"</div>");
            out.println("</div>");
            
            out.println("</div>");
        }catch(Exception e)
        {
            out.println(e);
        } finally {
            out.close();
        }
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP <code>GET</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Handles the HTTP <code>POST</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}
